package cn.zqy.demo.day11.demo04;

public class Hero {
    private String name;
    private int age;
    private Weapon weapon;
    private Skill skill;

    public Hero() {
    }

    public Hero(String name, int age, Weapon weapon, Skill skill) {
        this.name = name;
        this.age = age;
        this.weapon = weapon;
        this.skill = skill;
    }

    // weapon必须调用方法
    public void show(){
        System.out.println("名字为：" + this.name +"，" +  "年龄为" +
                this.age +"的勇士" + "拿" + this.weapon.getName() +" 杀人" + "用了");
        skill.use();
    }

    public String getName() {
        return name;
    }

    public void setName(String name) {
        this.name = name;
    }

    public int getAge() {
        return age;
    }

    public void setAge(int age) {
        this.age = age;
    }

    public Weapon getWeapon() {
        return weapon;
    }

    public void setWeapon(Weapon weapon) {
        this.weapon = weapon;
    }

    public Skill getSkill() {
        return skill;
    }

    public void setSkill(Skill skill) {
        this.skill = skill;
    }
}
